/**
 * @author rdru
 * INV: 
 */
package server;
	
	import java.util.LinkedList;
	import abstractions.CommandC;
import abstractions.LoggedUser;
import abstractions.User;

public class OpenDocument {
	int docId;				// id for open documents
	String docName;
	String text;			// doc contents before any user edits
	
	// Updates lists: newHist not sent to clients, oldHist already sent to clients
	volatile LinkedList<CommandC[]> newHist = new LinkedList<CommandC[]>();
	LinkedList<CommandC[]> oldHist = new LinkedList<CommandC[]>();
	
	// users currently editing the document
	public LinkedList<LoggedUser> editingUsers = new LinkedList<LoggedUser>();
	
	// general statistics
	volatile int upr = 0, ups = 0, n = 0;	// updates recieved/sent and total number of commands
	

	OpenDocument(int docId, String docName, String text) {
		this.docId = docId;
		this.docName = docName;
		this.text = text;
	}
}
